<script type="text/javascript">
	window.CKEDITOR_BASEPATH='/static/ckeditor/';
	CKEDITOR.config.filebrowserImageUploadUrl= '/article/upload_ck_img?uniq=<%=UNIQ%>';
	CKEDITOR.config.filebrowserLinkUploadUrl='/article/upload_ck_file?uniq=<%=UNIQ%>';
	CKEDITOR.replace('content', {"width":600,"height":200});
</script>
<script>
$(document).ready(function(e) {
	$(".example1").colorbox({width:"600px", height:"400px", iframe:true, opacity:0.3});
});
function callback_catid(arr){
	$('select[name=catid]').val(arr[0]);
	$.colorbox.close();	
}
function callback_thumb(arr){
	$('.'+arr['class']).eq(parseInt(arr['i'])).val(arr['url']);
  $.colorbox.close();
}

$('.clear_thumb').click(function(){
	var i=$(this).index('.clear_thumb');
	$('.thumb').eq(i).val('');	
});

</script>
<script>
$(document).ready(function(e) {
	$('#myform').submit(function(){
        var addondata={
            content:CKEDITOR.instances.content.getData()
        };
		var options = {
			data:addondata,
			type: "post",
			beforeSubmit: function(){},
			success: function(data){
				if(parseInt(data.code)>0){
					alert(data.msg);	
					<% if (AA=='mod'){ %>location.href=$('input[name=FORWARD]').val();<% }else{ %>location.reload();<% } %>
				}else{
					alert(data.msg);
				}
			},
			dataType: "json",
			clearForm: false,
			resetForm: false,
			timeout: 5000
		};
		$(this).ajaxSubmit(options);
		
		return false;	
	});
	
});
</script>